package asia.yuanding.wechat.web.controller;

import asia.yuanding.wechat.system.util.ThreadUser;
import asia.yuanding.wechat.web.entity.User;
import asia.yuanding.wechat.web.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @ClassName: BaseController
 * @Author: YuanDing
 * @Date: 2025/7/26 12:32
 * @Description:
 */

@Component
public class BaseController {



    @Autowired
    private UserService userService;

    public User getCurrentUser() {
        String uId = ThreadUser.getUId();
        return userService.getById(uId);
    }

    public String getCurrentUId() {
        return ThreadUser.getUId();
    }


}
